package lab01;

import java.util.Scanner;

public class Test06 {
    public static void main(String[] args) {
        System.out.println("测试if语句");
        System.out.println("请输入学生的成绩(为1,2,3,4,5)");
        Scanner s = new Scanner(System.in);
        int grade = s.nextInt();

        if(grade == 1) {
            System.out.println("不及格");
        }else if(grade == 2) {
            System.out.println("及格.");
        }else if(grade == 3) {
            System.out.println("中等.");
        }else if(grade == 4) {
            System.out.println("良好.");
        }else if(grade == 5) {
            System.out.println("优秀.");
        }

        switch (grade) {
            case 1:
                System.out.println("不及格");
                break;
            case 2:
                System.out.println("及格");
                break;
            case 3:
                System.out.println("中等");
                break;
            case 4:
                System.out.println("良好");
                break;
            case 5:
                System.out.println("优秀");
                break;
        }
    }
}



